<!--
 * @Descripttion: 
 * @version: 
 * @Author: Xugang
 * @Date: 2022-04-15 16:56:59
 * @LastEditors: Xugang
 * @LastEditTime: 2022-04-15 17:40:56
-->
<template>
  <div class="container">
    <div class="tableContianer">
      <div class="box">
        <colorTable :tableData="tableData" :tableOption="tableOption">
          <template v-slot:status="{ status }">
            <div
              :style="{
                background: status.status ? 'green' : 'red',
                color: '#fff',
                textAlign: 'center',
              }"
            >
              {{ status.status ? "开启" : "关闭" }}
            </div>
          </template>
        </colorTable>
      </div>
      <div class="box">1</div>
      <div class="box">2</div>
      <div class="box">3</div>
    </div>
  </div>
</template>

<script>
import colorTable from "@/components/colorTable/index.vue";
export default {
  components: {
    colorTable,
  },
  data() {
    return {
      tableData: [
        { a: 1, b: 2, c: 3, d: 4, e: 5, status: true },
        { a: 2, b: 3, c: 4, d: 5, e: 6, status: false },
        { a: 3, b: 4, c: 5, d: 6, e: 7, status: true },
        { a: 4, b: 5, c: 6, d: 7, e: 8, status: false },
        { a: 5, b: 6, c: 7, d: 8, e: 9, status: true },
      ],
      tableOption: [
        { label: "街道", prop: "a", width: 100 },
        { label: "数据1", prop: "b", width: 100, color: "#a9ecba" },
        { label: "数据2", prop: "c", width: 100, color: "#4ba69d" },
        { label: "数据3", prop: "d", width: 100, color: "#88440a" },
        { label: "数据4", prop: "e", color: "#accdb5" },
        { label: "状态", prop: "status", width: 100, slotName: "status" },
      ],
    };
  },

  created() {},

  methods: {},
};
</script>

<style scoped lang='less'>
.container {
  padding-top: 126px;
  width: 100%;
  box-sizing: content-box;
  height: calc(100% - 126px);
  background-color: skyblue;
  .tableContianer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    .box {
      width: 49%;
      background-color: #08263c;
      margin-bottom: 20px;
    }
  }
}
</style>
